<template>
	<view class="pages">
		<!-- 模块1 -->
		<view class="items">
			<view class="modelTherr fineFontSytle">
				Level Commission Info
				<!-- {{$t('PaymentHistory')}} -->
			</view>
			<view class="dataContent" v-for="(PersonnaDetalis , index) in dadaList.list">
				<view class="line" v-if="index != 0">
					<!-- 线 -->
				</view>
				<view class="items_ch">
					<view class="items_ch_left " style="width: 50%;">
						<view class="items_ch_left_top fineFontSytle">
							NAME
						</view>
						<view class="items_ch_left_buttom strongFontSytle">
							{{PersonnaDetalis.real_name || ''}}
						</view>
					</view>
					<view class="items_ch_right" style="width: 50%;">
						<view class="items_ch_right_top fineFontSytle">
							ID
							<!-- {{$t('CommissionDtails.AgentLevel')}} -->
						</view>
						<view class="items_ch_right_buttom  strongFontSytle">
							<!-- EP -->
							{{PersonnaDetalis.id || ''}}
						</view>
					</view>
				</view>
				<view class="items_ch">
					<view class="items_ch_left" style="width: 50%;">
						<view class="items_ch_left_top fineFontSytle">
							LEVEL
						</view>
						<view class="items_ch_left_buttom strongFontSytle">
							<!-- 4930.73 -->
							{{PersonnaDetalis.level || ''}}
						</view>
					</view>
					<view class="items_ch_right" style="width: 50%;">
						<view class="items_ch_right_top fineFontSytle">
							TOTAL TP
						</view>
						<view class="items_ch_right_buttom strongFontSytle">
							<!-- {{PersonnaDetalis.cate_name || ''}} -->
							<!-- 无内容 -->
						</view>
					</view>
				</view>
				<view class="items_ch">
					<view class="items_ch_left" style="width: 50%;">
						<view class="items_ch_left_top fineFontSytle">
							TOTAL LEVEL COMMISSION
						</view>
						<view class="items_ch_left_buttom strongFontSytle">
							${{ $formatNumberWithCommas(PersonnaDetalis.income ? PersonnaDetalis.income : 0)}}
						</view>
					</view>
					<view class="items_ch_right" style="width: 50%;">
						<view class="items_ch_right_top fineFontSytle">
							TP PAID
						</view>
						<view class="items_ch_right_buttom strongFontSytle">
							${{ $formatNumberWithCommas(PersonnaDetalis.pay_tp ? PersonnaDetalis.pay_tp : 0)}}
						</view>
					</view>
				</view>
				
				
				<view class="items_ch">
					<view class="items_ch_left" style="width: 50%;">
						<view class="items_ch_left_top fineFontSytle">
							UNPAID TP
						</view>
						<view class="items_ch_left_buttom strongFontSytle">
							${{ $formatNumberWithCommas(PersonnaDetalis.not_pay_tp ? PersonnaDetalis.not_pay_tp : 0)}}
						</view>
					</view>
					<view class="items_ch_right" style="width: 50%;">
						<view class="items_ch_right_top fineFontSytle">
							COMMISSION PAID
						</view>
						<view class="items_ch_right_buttom strongFontSytle">
							${{ $formatNumberWithCommas(PersonnaDetalis.pay_income ? PersonnaDetalis.pay_income : 0)}}
						</view>
					</view>
				</view>
				
				<view class="items_ch">
					<view class="items_ch_left" style="width: 50%;">
						<view class="items_ch_left_top fineFontSytle">
							UNPAID COMMISSION
						</view>
						<view class="items_ch_left_buttom strongFontSytle">
							<!-- $277.69 -->
							${{ $formatNumberWithCommas(PersonnaDetalis.not_pay_income ? PersonnaDetalis.not_pay_income : 0)}}
						</view>
					</view>

				</view>
				
			</view>
		</view>
		
		<!-- 模块2 -->
		<view class="items">
			<view class="modelTherr fineFontSytle">
				Payment Info
				<!-- {{$t('PaymentHistory')}} -->
			</view>
			<view class="dataContent" v-for="(payDetalis , index) in dadaList.pay">
				<view class="line" v-if="index != 0">
					<!-- 线 -->
				</view>
				<view class="items_ch">
					<view class="items_ch_left " style="width: 50%;">
						<view class="items_ch_left_top fineFontSytle">
							NAME
						</view>
						<view class="items_ch_left_buttom strongFontSytle">
							{{payDetalis.real_name || ''}}
						</view>
					</view>
					<view class="items_ch_right" style="width: 50%;">
						<view class="items_ch_right_top fineFontSytle">
							ID
							<!-- {{$t('CommissionDtails.AgentLevel')}} -->
						</view>
						<view class="items_ch_right_buttom  strongFontSytle">
							<!-- EP -->
							{{payDetalis.id || ''}}
						</view>
					</view>
				</view>
				<view class="items_ch">
					<view class="items_ch_left" style="width: 50%;">
						<view class="items_ch_left_top fineFontSytle">
							LEVEL
						</view>
						<view class="items_ch_left_buttom strongFontSytle">
							<!-- 4930.73 -->
							{{payDetalis.level || ''}}
						</view>
					</view>
					<view class="items_ch_right" style="width: 50%;">
						<view class="items_ch_right_top fineFontSytle">
							PAYMENT TP
						</view>
						<view class="items_ch_right_buttom strongFontSytle">
							{{payDetalis.pay_tp || ''}}
							<!-- 无内容 -->
						</view>
					</view>
				</view>
				<view class="items_ch">
					<view class="items_ch_left" style="width: 50%;">
						<view class="items_ch_left_top fineFontSytle">
							TYPE
						</view>
						<view class="items_ch_left_buttom strongFontSytle">
							{{payDetalis.cate_name || ''}}
						</view>
					</view>
					<view class="items_ch_right" style="width: 50%;">
						<view class="items_ch_right_top fineFontSytle">
							PAYMENT DATE
						</view>
						<view class="items_ch_right_buttom strongFontSytle">
							{{payDetalis.pay_time | formatter('yyyy-mm-dd')}}
						</view>
					</view>
				</view>
				
				<view class="items_ch">
					<view class="items_ch_left" style="width: 50%;">
						<view class="items_ch_left_top fineFontSytle">
							PERSONAL COMMISSIONS PAID
						</view>
						<view class="items_ch_left_buttom strongFontSytle">
							${{ $formatNumberWithCommas(payDetalis.income ? payDetalis.income : 0)}}
						</view>
					</view>

				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				newUrl: 1, //0为新接口1为老接口
				dadaList: [],
			}
		},
		onLoad(option) {
			console.log(option,'optionoptionoptionoption');
			this.getList(option.data)
		},
		methods: {
			// 获取数据
			async getList(id) {
				uni.showLoading({
					title: this.$t('Laoding'),
				})
				const res = await this.$get(`/backend/user-income/level`, {
					order_id: id
				}, this.newUrl)
				this.dadaList = res.data.data
			},
		}
	}
</script>


<style>
	.pages {
		width: 100%;
		height: 100vh;
		overflow-y: auto;
		/* padding: 0 26rpx; */
		box-sizing: border-box;
		background-color: #F0F0F0;
		padding: 30rpx 25rpx 120rpx;
		box-sizing: border-box;
	}

	.items {
		overflow: auto;
		width: 100%;
		background-color: #fff;
		padding: 54rpx 32rpx 85rpx;
		box-sizing: border-box;
		margin-bottom: 20rpx;
		border-radius: 10rpx;
	}

	.items_h {
		display: flex;
		align-items: center;
		margin-top: 20rpx;
		/* background-color: red; */
	}

	.items_h:first-child {
		margin-top: 0rpx;
	}

	.items_h_left {}

	.strongFontSytle {
		font-family: Montserrat;
		font-size: 28rpx;
		font-weight: 700;
		letter-spacing: 0em;
		text-align: left;

	}

	.fineFontSytle {
		font-family: Montserrat;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 22px;
		letter-spacing: 0em;
		text-align: left;

	}

	.Status {
		display: inline-block;
		height: 40rpx;
		line-height: 36rpx;
		background-color: #73E11D;
		padding: 0 20rpx;
		font-family: Inter;
		font-size: 24rpx;
		font-weight: 700;
		letter-spacing: 0em;
		text-align: center;
		color: #fff;
		border-radius: 20rpx;

	}

	.items_bh {
		display: flex;
		align-items: center;
		margin-top: 20rpx;

	}

	.items_bh:first-child {
		margin-top: 0;
	}

	.items_bh_list {
		width: 250rpx;
	}
	.items_ch {
		display: flex;
		align-items: center;
	}
	.items_ch_left_buttom,.items_ch_right_buttom {
		margin-top: 10rpx;
	}
	.items_ch {
		margin-top: 35rpx;
	}
	.items_ch:first-child {
		margin-top: 0;
	}
	.line {
		width: 100%;
		height: 2rpx;
		background-color: #808080;
		margin-top: 35rpx;
	}
	.modelTherr {
		width: 100%;
		margin-bottom: 35rpx;
		font-weight: 700;
		font-size: 28rpx;
	}
	.funBox {
		display: flex;
		align-items: center;
		align-items: center;
		flex-direction: column;
	}
	.items_li {
		width: 100%;
		height: 60rpx;
		border: 2rpx solid #273562;
		border-radius: 30rpx;
		text-align: center;
		line-height: 53rpx;
		margin-top: 25rpx;
		background-color: #273562;
		color: #fff;
	}
	.items_li:active {
		background-color: #384d8d;
	}
</style>